<template>
  <div class="app-container home">
    <div style="font-size: 24px">欢迎使用框架平台</div>
    <el-divider/>
    <el-row :gutter="20">
      <el-col :xs="24" :sm="24" :md="12" :lg="8">
        <el-card class="update-log">
          <div slot="header" class="clearfix">
            <span>公司简介</span>
          </div>
          <div class="body">
            <span style="display: inline-block; height: 30px; line-height: 30px">
              展示公司简介
            </span>
          </div>
        </el-card>
      </el-col>
      <el-col :xs="24" :sm="24" :md="12" :lg="8">
        <el-card class="update-log">
          <div slot="header" class="clearfix">
            <span>联系信息</span>
          </div>
          <div class="body">
            <p>
              <i class="el-icon-s-promotion"></i> 官网：
              <el-link href="展示公司官网链接" target="_blank">展示公司官网链接</el-link>
            </p>
            <p>
              <i class="el-icon-phone"></i> 电话：<a href="javascript:;">展示公司联系电话</a>
            </p>
            <p>
              <i class="el-icon-add-location"></i> 地址：<a
              href="javascript:;">展示公司联系地址</a>
            </p>
          </div>
        </el-card>
      </el-col>
      <el-col :xs="24" :sm="24" :md="12" :lg="8">
        <el-card class="update-log">
          <div slot="header" class="clearfix">
            <span>更新日志</span>
          </div>
          <el-collapse accordion>
            <el-collapse-item v-for="changelog in updateLogList"
                              :title="changelog.logVersion + ' - ' + parseTime(changelog.updateDate,'{y}-{m}-{d}')">
              <div v-html="changelog.logContent"></div>
            </el-collapse-item>
          </el-collapse>
          <div style="text-align: center;margin-top: 10px">
            <div @click="toUpdateLogList()">查看更多</div>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import {parseTime} from '../utils/ruoyi';
import {queryUpdateLogListByPage} from "@/api/system/updateLog";

export default {
  name: "Index",
  data() {
    return {
      updateLogList: [],
      queryParams: {
        pageNum: 1,
        pageSize: 5,
      },
    };
  },
  created() {
    this.getList();
  },
  methods: {
    goTarget(href) {
      window.open(href, "_blank");
    },
    getList() {
      queryUpdateLogListByPage(this.queryParams).then(response => {
        this.updateLogList = response.rows;
      });
    },
    toUpdateLogList() {
      this.$router.push({path: "/system/log/updateLog"})
    }
  },
};
</script>

<style scoped lang="scss">
.home {
  blockquote {
    padding: 10px 20px;
    margin: 0 0 20px;
    font-size: 17.5px;
    border-left: 5px solid #eee;
  }

  hr {
    margin-top: 20px;
    margin-bottom: 20px;
    border: 0;
    border-top: 1px solid #eee;
  }

  .col-item {
    margin-bottom: 20px;
  }

  ul {
    padding: 0;
    margin: 0;
  }

  font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  color: #676a6c;
  overflow-x: hidden;

  ul {
    list-style-type: none;
  }

  h4 {
    margin-top: 0px;
  }

  h2 {
    margin-top: 10px;
    font-size: 26px;
    font-weight: 100;
  }

  p {
    margin-top: 10px;

    b {
      font-weight: 700;
    }
  }

  .update-log {
    ol {
      display: block;
      list-style-type: decimal;
      margin-block-start: 1em;
      margin-block-end: 1em;
      margin-inline-start: 0;
      margin-inline-end: 0;
      padding-inline-start: 40px;
    }
  }
}
</style>

